<?php
if(isset($_POST['gerar']))
{
	require_once "Classes/Conexao.php";
	$conn = new Conexao($_POST['host'], $_POST['user'], $_POST['password'], $_POST['db']); 
	
	require_once "Classes/GerarExcel.php";	
	$gerar = new GerarExcel();
	$gerar->SetConsulta($_POST['consulta']);
	$gerar->Gerar();
	echo $gerar->GetError(); 
}else
	echo "<h1>Por favor, clique no botão 'Gerar Excel'.</h1>";
?>